<template>
  <div>
    <div class="top">
      <div class="box">
        <div class="item" v-for="(item, index) in data" :key="index" @click="goDetails(item.id,false)">
          <div class="imgbox">
            <img class="aimg" :src="item.img" alt="" v-lazy="item.img" />
          </div>
          <div class="tit one-text">{{ item.nm }}</div>
          <div class="ri">上映日期：{{item.rt?item.rt:'不详'}}</div>
          <div class="ren one-text">演员：{{item.star?item.star:'不详'}}</div>
          <div class="sum">{{item.sc.toFixed(1)}}<span class="fen"> 分</span></div>
        </div> 
      </div>
    </div>
  </div>
</template>
    
    <script>
export default {
  name: "Water1",
  data() {
    return {
      data: [],
    };
  },
  created() {
    this.getVideo();
  },
  methods: {
    getVideo() {
      this.axios({
        method: "get",
        url: "https://apis.netstart.cn/maoyan/index/moreComingList?movieIds=1363244,1331230,1417305,1199023,246968,1236599,1370269,1280799,1285684,1370983",
      })
        .then((result) => {
          this.$toast("加载成功！");
          
          this.data = result.data.coming;
        })
        .catch((err) => {
          
        });
    },
    goDetails(id, type) {
      this.$router.push({ name: "Details", params: { id, type } });
    }
  },
};
</script>
    
<style lang="less" scoped>
.top {
  width: 96%;
  background-color: #fff;
  margin: 0 auto;
  border-radius: 10px;
  margin-bottom: 55px;
  .title {
    margin-left: 10px;
    line-height: 50px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
  }
}
.box {
  width: 96%;
  display: flex;
  justify-content: space-between;
  flex-flow: wrap;
  margin: 0 auto;
  padding: 0px 5px 5px;
}
.item {
  width: 48%;
  margin-bottom: 10px;
  border-radius: 10px;
  background-color: #fcfafa;
  overflow: hidden;
  padding-bottom: 6px;
  position: relative;
  .imgbox {
    width: 100%;
    .aimg {
      width: 100%;
      display: block;
      height: 235px;
    }
  }
  .tit {
    width: 100%;
    font-size: 17px;
    color: #444;
    font-weight: bold;
    margin: 7px 0;
  }
  .ren,.ri{
      font-size: 13px;
      color: #444;
      font-weight: bold;
      margin-bottom: 7px;
  }
  .sum{
      position: absolute;
      right: 5px;
      bottom: 100px;
      color: #faaf00;
      font-weight: bold;
      font-size: 15px;
  }
  .fen{
      font-size: 13px;
      font-weight: normal;
  }
  .di {
    width: 100%;
    height: 20px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    padding: 5px 10px 20px;
    box-sizing: border-box;
    text-align: center;
    line-height: 20px;
    .di1 {
      display: flex;
      .tou {
        width: 20px;
        height: 20px;
        margin-right: 5px;
      }
      .text{
          width: 66px;
      }
    }
  }
}
</style>
